<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:permission="http://www.w3.org/1999/xhtml">
<head th:include="/common/head::commonHead('用户管理',~{::link},~{})">
    <link rel="stylesheet" th:href="@{/css/index.css}" media="all">
</head>
<body id="body-container">
<div class="layui-btn-group demoTable">
    <button permission:hasPermission="user::save" data-type="saveUser" class="layui-btn layui-btn-sm layui-btn-primary">
        <i class="layui-icon layui-icon-add-circle-fine"></i> 新增
    </button>
    <button permission:hasPermission="user::update"  data-type="getCheckData" class="layui-btn layui-btn-sm layui-btn-primary">
        <i class="layui-icon layui-icon-edit"></i> 修改
    </button>
    <button permission:hasPermission="user::delete" data-type="isAll" class="layui-btn layui-btn-sm layui-btn-primary">
        <i class="layui-icon layui-icon-delete"></i> 删除
    </button>
</div>
<table class="layui-hide" id="data" lay-filter="user"></table>
<div id="showForm" class="hide">
    <div class="x-body">
        <form class="layui-form">
            <div class="layui-form-item">
                <label for="account" class="layui-form-label">
                    <span class="x-red">*</span>账号
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="account" name="account" required="" lay-verify="required"
                           autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>将会成为您唯一的登入名
                </div>
            </div>
            <div class="layui-form-item">
                <label for="name" class="layui-form-label">
                    <span class="x-red">*</span>姓名
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="name" name="name" required="" lay-verify="required"
                           autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>
                </div>
            </div>
            <div class="layui-form-item">
                <label for="phone" class="layui-form-label">
                    <span class="x-red">*</span>手机
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="phone" name="phone" required="" lay-verify="phone"
                           autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>
                </div>
            </div>
            <div class="layui-form-item">
                <label for="email" class="layui-form-label">
                    <span class="x-red">*</span>邮箱
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="email" name="email" required="" lay-verify="email"
                           autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span>
                </div>
            </div>
            <div class="layui-form-item" id="roleView">

            </div>
            <div class="layui-form-item">
                <label for="password" class="layui-form-label">
                    <span class="x-red">*</span>密码
                </label>
                <div class="layui-input-inline">
                    <input type="password" id="password" name="password" required="" lay-verify="password"
                           autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">
                    6到16个字符
                </div>
            </div>
            <div class="layui-form-item">
                <label for="repassword" class="layui-form-label">
                    <span class="x-red">*</span>确认密码
                </label>
                <div class="layui-input-inline">
                    <input type="repassword" id="repassword" name="repassword" required="" lay-verify="repassword"
                           autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"></label>
                <button  class="layui-btn" lay-filter="add" lay-submit="">
                    增加
                </button>
            </div>
        </form>
    </div>
</div>

<!--角色模板-->
<script id="roleTpl" type="text/html">
    <label class="layui-form-label"><span class="x-red">*</span>{{ d.title }}</label>
    <div class="layui-input-block">
        {{#  layui.each(d.list, function(index, item){ }}
            {{# if(item.checked){ }}
                    <input type="checkbox" name="roleId[{{ item.id }}]" value="{{ item.id }}" lay-skin="primary" title="{{ item.name }}"  checked="checked"  >
            {{# }else{ }}
                    <input type="checkbox"  name="roleId[{{ item.id }}]" value="{{ item.id }}" lay-skin="primary" title="{{ item.name }}"  >
            {{# } }}
        {{#  }); }}
        {{#  if(d.list.length === 0){ }}
        无数据
        {{#  } }}
    </div>
</script>
<script th:src="@{/js/system/user/user.js}"></script>
</body>
</html>